package vip.xumy.admin.bmap.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import vip.xumy.admin.bmap.mapper.ICityLocateMapper;
import vip.xumy.admin.bmap.pojo.CityLocate;

/**
 * @author:mengyxu
 * @date:2021年10月25日
 */

@Service
public class CityLocateService {
	@Autowired
	private ICityLocateMapper cityLocateMapper;

	public List<CityLocate> list(CityLocate example) {
		return cityLocateMapper.list(example);
	}

	public CityLocate get(Integer id) {
		CityLocate example = new CityLocate();
		example.setId(id);
		List<CityLocate> list = cityLocateMapper.list(example);
		if (list == null || list.isEmpty()) {
			return null;
		}
		return list.get(0);
	}

	public CityLocate get(String name) {
		CityLocate example = new CityLocate();
		example.setName(name);
		List<CityLocate> list = cityLocateMapper.list(example);
		if (list == null || list.isEmpty()) {
			return null;
		}
		return list.get(0);
	}

}
